#!/usr/bin/env python
#coding=utf-8
# Lxml 的介绍
import lxml.html
broken_html = '<ul class=country><li>Area<li>Popolation</ul>'
tree = lxml.html.fromstring(broken_html)
fixed_htm = lxml.html.tostring(tree, pretty_print=True) # 具有重塑作用。对于不规则的html具有重塑作用。
print fixed_htm
